using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Backend.JYD.Model.Cust;

namespace Backend.JYD.EFDAL.Mapping
{
    public class CustMarketingInfoMap : EntityTypeConfiguration<CustMarketingInfo>
    {
        public CustMarketingInfoMap()
        {
            // Primary Key
            this.HasKey(t => t.MarketingId);

            // Properties
            this.Property(t => t.CustNo)
                .HasMaxLength(20);

            this.Property(t => t.CustName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.PaperType)
                .HasMaxLength(5);

            this.Property(t => t.PaperNo)
                .HasMaxLength(50);

            this.Property(t => t.Phone)
                .HasMaxLength(20);

            this.Property(t => t.Memo)
                .HasMaxLength(500);

            this.Property(t => t.Ways)
                .HasMaxLength(50);

            this.Property(t => t.Remark)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("CustMarketingInfo");
            this.Property(t => t.MarketingId).HasColumnName("MarketingId");
            this.Property(t => t.CustNo).HasColumnName("CustNo");
            this.Property(t => t.CustName).HasColumnName("CustName");
            this.Property(t => t.PaperType).HasColumnName("PaperType");
            this.Property(t => t.PaperNo).HasColumnName("PaperNo");
            this.Property(t => t.Phone).HasColumnName("Phone");
            this.Property(t => t.TaskId).HasColumnName("TaskId");
            this.Property(t => t.TaskDetailId).HasColumnName("TaskDetailId");
            this.Property(t => t.ScheduleTime).HasColumnName("ScheduleTime");
            this.Property(t => t.Memo).HasColumnName("Memo");
            this.Property(t => t.Ways).HasColumnName("Ways");
            this.Property(t => t.TouchTime).HasColumnName("TouchTime");
            this.Property(t => t.Remark).HasColumnName("Remark");
            this.Property(t => t.ValidDays).HasColumnName("ValidDays");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
            this.Property(t => t.OpId).HasColumnName("OpId");
        }
    }
}
